import { createWebHistory, createRouter } from "vue-router";
// const VITE_APP_PUBLIC_PATH = import.meta.env.VITE_APP_PUBLIC_PATH;

import { qiankunWindow } from "vite-plugin-qiankun/dist/helper";

let routes = [
  {
    path: "/home",
    component: () => import("@/views/home/index.vue"),
  },
  {
    path: "/sub",
    component: () => import("@/views/sub/index.vue"),
  },

];

let base = qiankunWindow.__POWERED_BY_QIANKUN__ ? "/aca/" : "/";
console.log('base', qiankunWindow.__POWERED_BY_QIANKUN__ , base);

const router = createRouter({
  history: createWebHistory(base),
  routes,
  // scrollBehavior(to, from, savedPosition) {
  //   if (savedPosition) {
  //     return savedPosition;
  //   } else {
  //     return { top: 0 };
  //   }
  // },
});

export default router;
